<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index.html</title>
</head>
<body>
    <div id="app">
        <form>
            <input type="text" name="username" v-model="formData.username"><br/>
            <input type="password" name="password" v-model="formData.password"><br/>
            <input type="button" value="提交" @click="add()"><br/>
        </form>
    </div>
    <script src="vue.js"></script>
    <script src="axios-0.18.0.js"></script>
    <script>
        new Vue({
            el:"#app",
            data:{
                formData:{}
            },
            methods:{
                add(){
                    axios.get('body' , this.formData).then(response=>{
                        console.log(response)
                    }).catch(error=>{
                        console.log(error)
                    })
                }
            }
        })
    </script>

    <br/>

    <form action="savePerson" method="post">
        姓名：<input type="text" name="name" placeholder="请输姓名" >
        年龄：<input type="text" name="age" placeholder="请输年龄" >
        生日：<input type="text" name="birthday" placeholder="请输生日">
        <br/>
        宠物：  <!-- 级联操作 -->
        <!--<input type="text" name="pet.petName" placeholder="宠物名字" >
        <input type="text" name="pet.petAge" placeholder="宠物年龄" >-->
        <input type="text" name="pet" value="龙猫#5" placeholder="宠物" >
        <br/>
        <input type="submit" value="增加" >
    </form>

</body>
</html>